<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
<form method="post">
    <textarea name="input"></textarea>
    <input type="submit" value="Count words" />
</form>
<?php
if (isset($_POST['input'])) {
    $inputText = $_POST['input'];
    $result = '';

    for ($i = 0; $i < strlen($inputText); $i++) {
        if (ord($inputText[$i]) % 2 === 0) {
            $result .= "<span style='color: red'>$inputText[$i]</span> ";
        }
        else {
            $result .= "<span style='color: blue'>$inputText[$i]</span> ";
        }
    }

    echo $result;
}
?>
</body>
</html>